/*
 * @Author: 别拿暗恋当饭吃. 13466071+lililkli@user.noreply.gitee.com
 * @Date: 2024-07-08 08:44:12
 * @LastEditors: 别拿暗恋当饭吃. 13466071+lililkli@user.noreply.gitee.com
 * @LastEditTime: 2024-07-10 18:53:18
 * @FilePath: \doctor\src\pages\Consultationinformation\Listofinformation\index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, { useEffect } from "react";
import { NavBar, Space, Toast } from 'antd-mobile'
import { useNavigate } from "react-router-dom";
import { useDispatch, useSelector } from 'react-redux'
import { doPatientInformationPage, PatientInformationPageslice } from 'store/Consultationinformation/PatientInformationPage'
import icon1 from '../../../assets/icon/my_icon_height_n.png';
import icon2 from '../../../assets/icon/my_icon_weight_n.png';
import icon3 from '../../../assets/icon/my_icon_age_n.png';
import img1 from '../../../assets/诊断.png'
import icon4 from '../../../assets/icon/common_icon_boy_n.png'
import icon5 from '../../../assets/icon/common_icon_girl_n.png'
import './style.scss'
const Index = () => {
    let imageSrc;
    
    // navigate
    const navigate = useNavigate()
    // diapatch
    const dispatch = useDispatch<any>()
    const back = () => {
        navigate(-1)
    }
    // 拿到数据
    const list = useSelector(PatientInformationPageslice)

    console.log(list);


    useEffect(() => {
        const userId = 175
        dispatch(doPatientInformationPage(userId))
    }, [dispatch])
    return (
        // 大盒子
        <div className="PatientInformationPage">
            {/* 上盒子 */}
            <div className="PatientInformationPage-header">
                <NavBar onBack={back}></NavBar>
            </div>
            {/* 中间盒子 */}
            <div className="PatientInformationPage-con">
                {/* 中间盒子上 */}
                <div className="PatientInformationPage-con-top">
                    {/* 中间盒子上  上*/}
                    <div className="PatientInformationPage-con-top-top">
                        <img src={list ? `${list.userHeadPic}` : ""} alt="" />
                        <p>
                            {list ? `${list.nickName}` : ""}
                        </p>
                    </div>
                    {/* 中间盒子上  内容*/}
                    <div className="PatientInformationPage-con-top-con">
                        <ul>
                            <li>
                                <p>{list ? `${list.height}` : ''}</p>
                                <img src={icon1} alt="" />
                            </li>
                            <li>
                                <p>{list ? `${list.weight}` : ''}</p>
                                <img src={icon2} alt="" />
                            </li>
                            <li>
                                <p>{list ? `${list.age}` : ''}</p>
                                <img src={icon3} alt="" />
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            {/* 下边盒子 */}
            <div className="PatientInformationPage-bot">
                <ul>
                    <li>
                        <h3>[主要病症]</h3>
                        <p>面部神经</p>
                    </li>
                    <li>
                        <h3>[现病史]</h3>
                        <p>周围性神经炎，下巴倾斜，口齿不清，眼睛以额闭合不了，右边脸明显动不了</p>
                    </li>
                    <li>
                        <h3>[既往病史]</h3>
                        <p>无</p>
                    </li>
                    <li>
                        <h3>[最后一次治疗经历]</h3>
                        <div>
                            <p>北京天坛医院<span>2018-12-18</span></p>
                            <p>
                                每天进行扎针和按摩，现在情况已经好转了，眼睛基本能一闭合了说话也没有那么费劲了
                            </p>
                        </div>
                    </li>
                    <li>
                        <h3>[相关图片]</h3>
                        <img src={img1} alt="" />
                    </li>
                </ul>
            </div>
        </div>
    )
}
export default Index